home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Personal Computer World 2009 February
/
PCWFEB09.iso
/
Software
/
Linux
/
Kubuntu 8.10
/
kubuntu-8.10-desktop-i386.iso
/
casper
/
filesystem.squashfs
/
var
/
lib
/
dpkg
/
info
/
hal.preinst
< prev
next >
Wrap
Text File
|
2008-10-26
|
2KB
|
54 lines
#!/bin/sh
set -e
rm_conffile() {
PKGNAME="hal"
CONFFILE="$1"
if [ -e "$CONFFILE" ]; then
md5sum="`md5sum \"$CONFFILE\" | sed -e \"s/ .*//\"`"
old_md5sum="`dpkg-query -W -f='${Conffiles}' $PKGNAME | sed -n -e \"\\\\' $CONFFILE'{s/ obsolete$//;s/.* //p}\"`"
if [ "$md5sum" != "$old_md5sum" ]; then
echo "Obsolete conffile $CONFFILE has been modified by you."
echo "Saving as $CONFFILE.dpkg-bak ..."
mv -f "$CONFFILE" "$CONFFILE".dpkg-bak
else
echo "Removing obsolete conffile $CONFFILE ..."
rm -f "$CONFFILE"
fi
fi
}
case "$1" in
install|upgrade)
if dpkg --compare-versions "$2" le "0.5.2-1"; then
rm_conffile "/etc/hal/fdi/preferences.fdi"
rm_conffile "/etc/dev.d/block/hal-unmount.dev"
fi
if dpkg --compare-versions "$2" le "0.5.6-2"; then
rm_conffile "/etc/udev/scripts/device-removable.sh"
fi
if dpkg --compare-versions "$2" le "0.5.6-4"; then
rm_conffile "/etc/hal/fdi/preferences.fdi"
fi
if dpkg --compare-versions "$2" le "0.5.7.1-1"; then
deluser --quiet --system hal > /dev/null || true
fi
if dpkg --compare-versions "$2" lt "0.5.9-3"; then
if [ -x /etc/dbus-1/event.d/20hal ]; then
/etc/dbus-1/event.d/20hal stop
fi
rm_conffile "/etc/dbus-1/event.d/20hal"
fi
if dpkg --compare-versions "$2" lt "0.5.11-3"; then
rm_conffile "/etc/udev/hal.rules"
rm -f /etc/udev/rules.d/z99_hal.rules
rm_conffile "/etc/udev/rules.d/95-hal.rules"
fi
esac
exit 0